package file;

import java.io.*;

public class FileOutputStreamDemo1 {
    public static void main(String[] args) {
        FileOutputStream fos;
        FileInputStream fis;
        try {
            fos=new FileOutputStream("thread\\fileOutput.txt",true);//append方法添加内容到该文件末尾
            fis=new FileInputStream("thread\\fileOutput.txt");
            fos.write(50);
            fos.write('a');
            System.out.println(fis.read());
            System.out.println((char)fis.read());
            fos.close();
            fis.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
